package com.ysd.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ysd.Dao.Impl.CompanyDaoImpl;
import com.ysd.Dao.Impl.DesignDaoImpl;
import com.ysd.Dao.Impl.NewsDaoImpl;
import com.ysd.entity.Company;
import com.ysd.entity.Design;
import com.ysd.entity.News;

public class AboutServlet extends HttpServlet {
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	
		//调用实现类的方法
		CompanyDaoImpl cDao = new CompanyDaoImpl();
		Company  c = cDao.getCompany();
		request.setAttribute("c", c);
		//调用实现类的方法
		DesignDaoImpl dDao = new DesignDaoImpl();
		List<Design> d = dDao.getDesign();
		request.setAttribute("d", d);
		request.getRequestDispatcher("about.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
